#pragma once

#ifndef DIRECTINPUT_VERSION
#define DIRECTINPUT_VERSION 0x0800
#endif

#include <Windows.h>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
using namespace std;

#define inl __forceinline

char* _str(const char* msg,...);
#define PRINTF printf


#include "math/random.h"
#include "math\math.h"
#include "math\float2.h"
#include "math\float3.h"
#include "math/float4.h"
#include "math\float4x4.h"
#include "core\stringhash.h"
#include "core\assert.h"
#include "core\hashmap.h"

template <typename T>
inline void unordered_erase( vector<T>& v, uint32 index)
{
	v[index]=v.back();
	v.pop_back();
}

template <typename T,typename T2>
inline void unordered_erase( vector<T>& v, const T2& elem)
{
	typename vector<T>::iterator it=find(v.begin(),v.end(),elem);
	ASSERT(it!=v.end());
	*it=v.back();
	v.pop_back();
}

//#define GLASSERT
#define GLASSERT ASSERT(glGetError()==0)